package Object类.equals方法.test04;

public class Address {
    String city;
    String street;
    String zipcode;

    public Address() {
    }

    public Address(String city, String street, String zipcode) {
        this.city = city;
        this.street = street;
        this.zipcode = zipcode;
    }
    public boolean equals(Object o){
        if(o == this) return true;
        if(o == null || !(o instanceof Address)){
            return false;
        }
        Address a = (Address)o;
        return city.equals(a.city)
                && street.equals(a.street)
                && zipcode.equals(a.zipcode);
    }
}
